package com.reggie.mapper;

import com.github.pagehelper.Page;
import com.reggie.annotation.AutoFill;
import com.reggie.constant.AutoFillConstant;
import com.reggie.dto.EmployeePageQueryDTO;
import com.reggie.dto.PasswordEditDTO;
import com.reggie.entity.Employee;
import org.apache.ibatis.annotations.Param;

public interface EmployeeMapper {
    //根据用户名查询用户是否存在
    Employee findByName(String username);

    //添加员工
    @AutoFill(type = AutoFillConstant.INSERT)
    void save(@Param("employee") Employee employee);

    //分页查询
    Page<Employee> findByPage(EmployeePageQueryDTO employeePageQueryDTO);

    //根据id查询数据
    Employee findById(Long id);

    //修改员工信息
    @AutoFill(type = AutoFillConstant.UPDATE)
    void update(Employee employee);

    //员工启用和禁用
    void sterOrStop(@Param("status") Integer status, @Param("id") Long id);

    //修改密码
    void upPassword(@Param("id") Long empId, @Param("password") String newPassword);


}
